//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;

namespace OpenLS.Spreadsheet.Collections
{

    interface IFrugalDictionary<TValue> where TValue: class
    {
        int Count { get;}

        bool ContainsKey(int key);
        bool Remove(int key);

        IEnumerator<int> GetEnumerator();


        bool TryGetValue(int key, out TValue value);

        IFrugalDictionary<TValue> TryAddValue(int key, TValue value);
    }
#if DEBUG
   //\\ [ContractClassFor(typeof(IFrugalDictionary<>))]

    class FrugalDictionaryContract<TValue>: IFrugalDictionary<TValue> where TValue: class
    {
        bool IFrugalDictionary<TValue>.ContainsKey(int key)
        {
            return ContainsKey(key);
        }

        public bool Remove (int key)
        {
            Contract.Ensures(!ContainsKey(key));
            return default(bool);
        }

        public IEnumerator<int> GetEnumerator()
        {
            throw new NotImplementedException();
        }

        public bool TryGetValue(int key, out TValue value)
        {
            throw new NotImplementedException();
        }

        public IFrugalDictionary<TValue> TryAddValue(int key, TValue value)
        {
            throw new NotImplementedException();
        }

        public int Count
        {
            get { throw new NotImplementedException(); }
        }

        private bool ContainsKey(int key){
            return false;}
    }
#endif
}
